import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'semiApi/semiMaterial',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'semiApi/semiMaterial/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'semiApi/semiMaterial',
    method: 'put',
    data
  })
}

export function downloadFileAPI(params) {
  return request({
    url: '/semiApi/semiMaterial/downloadTemplate',
    method: 'get',
    responseType: 'blob',
    params
  })
}

export function uploadFileAPI(data) {
  return request({
    url: '/semiApi/semiMaterial/importExcel',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export default { add, edit, del }
